﻿<!--#include file="include/conn_f.asp"-->
<!--#include file="include/crypt.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<%
If Session("cust_id")="" Then
    Response.Write "请先登录会员,再使用此功能!"
    Response.End
End If
orders_id=saferequest("orders_id",1)
sql="select * from orders  where cust_id="&Session("cust_id")&" and orders.orders_id="&orders_id
Set rs=conn.execute(sql)
If Not rs.eof Then
    g_key="850697"&g_key
    goods_type=rs("goods_type")
%>
<table width="500" border="1" align="center" cellspacing="0" class="little">
    <tr>
        <td>
            定单号
        </td>
        <td>
            <%=orders_id%>
        </td>
    </tr>
    <% 
    If rs("goods_type")<>2 and rs("goods_type")<>5	Then 
        sql="select a.miane,b.card_name from card as a left join card_infor as b on a.card_infor_id=b.card_info_id where card_id="&rs("card_1")
        Set rs_card=conn.execute(sql)
        If Not rs_card.eof Then			
    %>
    <tr>
        <td>
            商品(卡)名称
        </td>
        <td>
            <%=rs_card("card_name")%>
        </td>
    </tr>
    <tr>
        <td>
            商品(卡)面额
        </td>
        <td>
            <%=rs_card("miane")%>
        </td>
    </tr>
    <%
        End If
    %>
    <tr>
        <td>
            数量
        </td>
        <td>
            <%=rs("card_1_amount")%>
        </td>
    </tr>
    <tr>
        <td>
            总金额(按人民币计)
        </td>
        <td>
            <%=rs("total_amount")%>
        </td>
    </tr>
    <%
    End If
    Response.Write "<tr bgcolor=#FFFFFF><td>商品/服务类型</td><td>"
    select case rs("goods_type")
        case 0	Response.Write "卡密-e-mail/网站显示发送(可定单查询)"
        case 1	Response.Write "直充-充入您提供的相关帐号"
        case 2	Response.Write "代汇款/代购"
        case 3	Response.Write "邮寄"
        case 4	Response.Write "扫描-扫描好后通过e-mail发送"
        case 5	Response.Write "储值"
        case 6	Response.Write "游戏币"		
        case Else	Response.Write "不详"
    end select	
    Response.Write "</td></tr>"
    If rs("goods_type")=1 Then
        sql_charge="select * from charge_detail where orders_id="&orders_id
        Set rs_charge=conn.execute(sql_charge)
        If Not rs_charge.eof Then
            Response.Write "<tr><td>充值帐号信息</td><td><table width='100%'>"
            Response.Write "<tr><td>游戏帐号：</td><td><font color=red>"&rs_charge("game_account")&"</font></td></tr>"
            Response.Write "<tr><td>充值方式：</td><td>"&rs_charge("charge_method")&"</td></tr>"
            Response.Write "<tr><td>服务器区：</td><td>"&rs_charge("server_area")&"</td></tr>"
            Response.Write "<tr><td>服务器名：</td><td>"&rs_charge("servername")&"</td></tr>"
            Response.Write "</table>"
        End If
    End If
    If rs("goods_type")=2 Then	'汇款的记录号
        Response.Write "<tr><td>汇款帐号信息</td><td><table width='100%'>"
        sql_huikuan="select * from huikuan where orders_id="&orders_id
        Set rs_huikuan=conn.execute(sql_huikuan)
        If Not rs_huikuan.eof Then
            Response.Write "<tr><td width=150>银行/代购名称</td><td width=350>"&rs_huikuan("bank_name")&"</td></tr>"
            Response.Write "<tr><td>开户行</td><td>"&rs_huikuan("province")&"</td></tr>"			 
            Response.Write "<tr><td>收款人银行帐号</td><td>"&rs_huikuan("account_name")&"</td></tr>"
            Response.Write "<tr><td>收款人姓名</td><td>"&rs_huikuan("name")&"</td></tr>"
            Response.Write "<tr><td>金额</td><td>"&rs_huikuan("amount")&"</td></tr>"
            Response.Write "<tr><td>商品/服务网址</td><td >"&rs_huikuan("usages")&"</td></tr>"
            Response.Write "<tr><td>备注</td><td ><font color='red'>"&rs_huikuan("memo_text")&"</font></td></tr>"
        End If
        Response.Write "</table>"
        rs_huikuan.close
    End If	
    %>
    <tr>
        <td>
            定单日期(北京时间)
        </td>
        <td>
            <%=GetBeijingTime(rs("order_time"))%>
        </td>
    </tr>
    <tr>
        <td>
            处理日期(北京时间)
        </td>
        <td>
            <%=GetBeijingTime(rs("process_time"))%>&nbsp;
        </td>
    </tr>
    <tr>
        <td>
            付款方式
        </td>
        <td>
            <%
    Response.Write GetPayMethod(rs("pay_method"))
            %>
        </td>
    </tr>
    <tr>
        <td>
            付款状态
        </td>
        <%	
    If rs("pay_status")=0 Then
        If rs("pay_method")=10 Then
            Response.Write "<td>未付款&nbsp;"
        %>
        <input type="button" onclick="location.href='wu_account.asp?orders_id=<%=orders_id%>&amount=<%=rs("total_amount")%>'"
            value="填西联汇款密码">
        </td>
        <%
        Else
            Response.Write "<td>未付款</td>"
        End If
    
    ElseIf rs("pay_status")=1 or rs("pay_status")=2 Then
        Response.Write "<td>已付款</td>"		
    ElseIf rs("pay_status")=3 Then
        Response.Write "<td>处理中</td>"
    ElseIf rs("pay_status")=4 Then
        Response.Write "<td>已退款</td>"
    ElseIf rs("pay_status")=6 Then
        Response.Write "<td>有问题,请联系客服</td>"
    ElseIf rs("pay_status")=5 Then
        Response.Write "<td>冻结,请联系客服</td>"
    Else
        Response.Write "<td>Unknown</td>"		
    End If
    
    Response.Write "</tr><tr><td>处理状态</td>"
    If rs("status")=0 Then
        Response.Write "<td>未处理</td>"
    ElseIf rs("status")=2 or rs("status")=5 Then
        Response.Write "<td>处理中</td>"
    ElseIf rs("status")=1 or rs("status")=3 Then
        Response.Write "<td>已处理</td>"
    ElseIf rs("status")=6 Then
        Response.Write "<td>需要确认,请联系客户服务</td>"
    ElseIf rs("status")=7 Then
        Response.Write "<td>即将退款</td>"
    ElseIf rs("status")=9 Then
        Response.Write "<td>缺货</td>"
    Else
        Response.Write "<td>不详</td>"
    End If
        %>
    </tr>
    <tr>
        <td>
            您填的备注
        </td>
        <td>
            <%=rs("memo_cust")%>&nbsp;
        </td>
    </tr>
    <tr>
        <td>
            客服给您的备注
        </td>
        <td>
            <font color='red'>
                <%=rs("memo_tocust")%></font>&nbsp;
        </td>
    </tr>
</table>
<%
    If rs("status")<>0 Then
        sql3="select cust_id from customer where username='"&Session("username")&"' and  cust_id="&Session("cust_id")
        Set rs3=conn.execute(sql3)
        If Not rs3.eof Then
%>
<table width="400" border="1" align="center" cellspacing="0" class="little">
    <caption>
        <font color='red'>请于购买后立即使用,发货后充值掉的卡由客户负责!</font>
        <tr>
            <td>
                编号
            </td>
            <td>
                卡号
            </td>
            <td>
                密码
            </td>
            <td>
                有效日期
            </td>
        </tr>
        <%			
            sql_card="select * from card_detail left join card_ref on card_detail.card_ref_id=card_ref.card_ref_id where orders_id="&orders_id&" and status=0"
            Set rs2=conn.execute(sql_card)			
            while Not rs2.eof 
                count=count+1
                Response.Write "<tr><td>"&count&"</td>"
                Response.Write "<td>"&rs2("username")&"</td>"
                Response.Write "<td>"&DeCrypt(rs2("password"))&"</td>"
                Response.Write "<td>"&rs2("expire_date")&"&nbsp;</td>"
                If goods_type=4 Then
                    Response.Write "<td><img src='http://www.cardinchina.com/card_scan/"&DeCrypt(rs2("password"))&".jpg'></td>"
                End If
                Response.Write "</tr>"
                rs2.movenext
            wend
            Response.Write "</table>"
            
        Else
            Response.Write "错误!"
        End If		
    Else
        Response.Write "<center>此定单还未处理!"
    End If
    If rs("read_status")=1 Then
        Response.Write "<br />已隐藏(<a href='history_dele.asp?orders_id="&orders_id&"&read=0'>显示此定单</a>)<br />"
    Else
        Response.Write "<br /><a href='history_dele.asp?orders_id="&orders_id&"&read=1'>隐藏此定单</a><br />"
    End If
Else
    Response.Write "错误!"
End If
        %>
        <br />
        如果此定单的卡或者充值等有问题,请按以下按钮投诉:<br />
        <center>
            <input type="button" onclick="location.href='orders_compl.asp?orders_id=<%=orders_id%>'"
                value="我要投诉"><br />
            如果此定单你已经做了投诉,请点一线按钮查看投诉回复:<br />
            <input type="button" onclick="location.href='orders_compl.asp?orders_id=<%=orders_id%>'"
                value="查看投诉回复">
        </center>
        <!--#include file="bottom.asp"-->
